package com.base.cn.platform.os.controller.op.advert;

import com.base.cn.platform.os.common.utils.result.ResultUtil;
import com.base.cn.platform.os.controller.cmmon.ApiBaseController;
import com.base.cn.platform.os.service.manage.op.advert.OpAdvertService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 广告数据接口Controller
 *
 * @author s.li
 * @create 2018-09-06-13:48
 */
@RestController
@RequestMapping("/api/advert")
public class ApiAdvertController extends ApiBaseController {

    @Autowired
    private OpAdvertService opAdvertService;

    /**
     * Banner图片列表
     * @return
     */
    @RequestMapping("/advertList")
    public Map<String,Object> advertList(){
        Map<String, Object> params = new HashMap<>();
        params.put("status", 1);
        params.put("placeKey", "APPBANNER");
        List<Map<String, Object>> advertList = opAdvertService.queryAdvertList(params, false, false, false);
        return ResultUtil.SUCCESS(advertList);
    }
}
